﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DeptList.aspx.cs" Inherits="Web.DeptList" %>

<!doctype html>
<html lang="en">
<head>
    <base target="_self" />
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <link href="yaml/core/base.min.css" rel="stylesheet" />
    <link href="yaml/forms/gray-theme.css" rel="stylesheet" />
    <link href="yaml/screen/typography.css" rel="stylesheet" />
    <!--[if lte IE 7]>
      <link rel="stylesheet" href="yaml/core/iehacks.min.css" type="text/css"/>
      <![endif]-->
    <!--[if lt IE 9]>
      <script src="yaml/lib/html5shiv/html5shiv.js"></script>
      <![endif]-->
		<style>
      .ym-fbox{margin:6px;}
			.hide{ display: none;}
		</style>
		<script>
		    function DeptEdit(id) {
		        var url = 'DeptEdit.aspx?id=' + id;
		        if (id == undefined) {url = 'DeptEdit.aspx'; }
		        var retVal = window.showModalDialog(url, window, 'dialogWidth=550px;dialogHeight=350px;status=no;help=no;');
		        if (retVal != undefined && retVal == "Succeed") {
		            location.reload();
		        }
		    }
		</script>
	</HEAD>
	<body>
		<form id="Form1" runat="server">
		    <div class="ym-fbox">
                <input id="btnAdd" type="button" value="新增" onclick="DeptEdit();" class="ym-button">
		    </div>
			<asp:Repeater ID="rptList" EnableViewState="False" Runat="server">
				<HeaderTemplate>
					<table class="s1 bordertable">
						<thead>
							<TR>
								<th width="50%">部门名称</th>
								<th width="15%">排序号</th>
								<th width="15%">是否有效</th>
								<th>操作</th>
							</TR>
						</thead><tbody>
				</HeaderTemplate>
				<ItemTemplate>
					<tr class="<%# Container.ItemIndex%2==0?"bg":""%>">
						<td><%#Eval("Text")%></td>
						<td><%#Eval("OrderNo")%></td>
						<td><%#Eval("IsValid")%></td>
						<td class="tdOperate"><span onclick="DeptEdit(<%#Eval("Id")%>);">[编辑]</span></td>
					</tr>
				</ItemTemplate>
				<FooterTemplate>
					</tbody> </table>
				</FooterTemplate>
			</asp:Repeater>
		</form>
	</body>
</HTML>